package com.prawn.ift.datasearch.pojo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;

@Entity
@Table(name="ift_data_record")
@SecondaryTable(name="ift_check_item")
@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})
public class DataRecordWithCheckItem implements Serializable {
    @Id
    private String id;//编号
    private String equipmentId;//所属设备编号
    private Integer channelNO;//通道序号,所属通道索引位置
    private String checkItemId;//检测项目ID
    private Float processedData;//数据值
    private java.sql.Date acquisitionTime;//采集时间
    private java.sql.Date reportingTime;//上报时间
    private Integer isWarning;//是否警告
    private Integer isRead;//是否读
    private Integer isTreatment;//是否处理
    private String warningReason;//警告原因
    //关联数据
//    @Column
    /*private String checkItemName;
    private String unit;*/
    //上报数据时间段
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "checkItemId",referencedColumnName="id",insertable = false,updatable = false)
    private CheckItem checkItem;

    public CheckItem getCheckItem() {
        return checkItem;
    }

    public void setCheckItem(CheckItem checkItem) {
        this.checkItem = checkItem;
    }

    @Transient //与数据库，sql操作无关
    private String sceneId;

    public String getSceneId() {
        return sceneId;
    }

    public void setSceneId(String sceneId) {
        this.sceneId = sceneId;
    }

    public DataRecordWithCheckItem() {
    }

    public DataRecordWithCheckItem(String id, String equipmentId, Integer channelNO, String checkItemId, Float processedData, Date acquisitionTime, Date reportingTime, Integer isWarning, Integer isRead, Integer isTreatment, String warningReason,CheckItem checkItem) {
        this.id = id;
        this.equipmentId = equipmentId;
        this.channelNO = channelNO;
        this.checkItemId = checkItemId;
        this.processedData = processedData;
        this.acquisitionTime = acquisitionTime;
        this.reportingTime = reportingTime;
        this.isWarning = isWarning;
        this.isRead = isRead;
        this.isTreatment = isTreatment;
        this.warningReason = warningReason;
        this.checkItem=checkItem;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getEquipmentId() {
        return equipmentId;
    }

    public void setEquipmentId(String equipmentId) {
        this.equipmentId = equipmentId;
    }

    public Integer getChannelNO() {
        return channelNO;
    }

    public void setChannelNO(Integer channelNO) {
        this.channelNO = channelNO;
    }

    public String getCheckItemId() {
        return checkItemId;
    }

    public void setCheckItemId(String checkItemId) {
        this.checkItemId = checkItemId;
    }

    public Float getProcessedData() {
        return processedData;
    }

    public void setProcessedData(Float processedData) {
        this.processedData = processedData;
    }

    public Date getAcquisitionTime() {
        return acquisitionTime;
    }

    public void setAcquisitionTime(Date acquisitionTime) {
        this.acquisitionTime = acquisitionTime;
    }

    public Date getReportingTime() {
        return reportingTime;
    }

    public void setReportingTime(Date reportingTime) {
        this.reportingTime = reportingTime;
    }

    public Integer getIsWarning() {
        return isWarning;
    }

    public void setIsWarning(Integer isWarning) {
        this.isWarning = isWarning;
    }

    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }

    public Integer getIsTreatment() {
        return isTreatment;
    }

    public void setIsTreatment(Integer isTreatment) {
        this.isTreatment = isTreatment;
    }

    public String getWarningReason() {
        return warningReason;
    }

    public void setWarningReason(String warningReason) {
        this.warningReason = warningReason;
    }



}
